local yeshi = fk.CreateSkill {
  name = "th_yeshi",
  attached_skill_name = "th_yeshi&",
  max_phase_use_time = 1,
}

yeshi:addEffect("active", {
  mute = true,
  card_num = 0,
  card_filter = Util.FalseFunc,
  target_num = 0,
  prompt = "#th_yeshi",
  target_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local choice_draw = "draw2"
    local choice_mashu = "#th_yeshi-mashu::"..player.id
    local choice = room:askToChoice(player, {
      choices = {choice_draw, choice_mashu},
      skill_name = yeshi.name,
      cancelable = false
    })
    if choice == choice_mashu then
      room:notifySkillInvoked(player, "th_yeshi", "support")
      room:addPlayerMark(player, "@@th_yeshi-turn", 1)
    else
      room:notifySkillInvoked(player, "th_yeshi", "drawcard")
      player:drawCards(2, "th_yeshi")
    end
  end,
}, { check_skill_limit = true })
yeshi:addEffect("distance", {
  name = "#th_yeshi_distance",
  correct_func = function(self, from, to)
    return -from:getMark("@@th_yeshi-turn")
  end
})

Fk:loadTranslationTable{
  ["th_yeshi"] = "夜市",
  [":th_yeshi"] = "每名角色的出牌阶段限一次，其可以交给你一张牌，然后你与其摸一张牌或令其本回合与其他角色的距离-1。",
  ["#th_yeshi"] = "夜市：摸两张牌或令你本回合与其他角色的距离-1",

  ["#th_quege-invoke"] = "雀歌：你可以令 %dest 本回合内不能指定与其距离大于1的角色为目标",
  ["#th_yeshi-draw"] = "你与%dest摸一张牌",
  ["#th_yeshi-mashu"] = "%dest本回合与其他角色的距离-1",
  ["@@th_quege-turn"] = "雀歌",
  ["@@th_yeshi-turn"] = "夜市",
}

return yeshi